﻿namespace EyeOpen.Domain
{
	using System.ComponentModel.DataAnnotations;
	using System.Security.Cryptography;
	using System.Text;

	public class User : UniqueEntity
	{
		[Required]
		[StringLength(100, MinimumLength = 7)]
		public string Email { get; set; }

		[MinLength(16)]
		public byte[] Password { get; set; }

		[Required]
		public bool Locked { get; set; }

		public static byte[] CreatePassword(string password)
		{
			return MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(password));			
		}
	}
}